package cn.kt.ipcount.chatgpt.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by tao.
 * Date: 2023/2/10 14:08
 * 描述:
 */
@Entity
@Data
@Table(name = "chatgpt_info")
public class ChatgptInfo implements Serializable {

    /**
     * 序列化id
     */
    private static final long serialVersionUID = 4125096758372084309L;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "prompt")
    private String prompt;

    @Column(name = "result")
    private String result;

    @Column(name = "ip")
    private String ip;

    @Column(name = "address")
    private String address;

    @Column(name = "ua")
    private String ua;

    @Column(name = "time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date time;

    @Column(name = "axis")
    private String axis;

    public ChatgptInfo() {
    }

    public ChatgptInfo(String prompt, String result, String ip, String address, String ua, Date time, String axis) {
        this.prompt = prompt;
        this.result = result;
        this.ip = ip;
        this.address = address;
        this.ua = ua;
        this.time = time;
        this.axis = axis;
    }
}
